package com.woniuxy.creditsystem.common.mapper;

import com.woniuxy.creditsystem.common.bean.CollectionFind;
import com.woniuxy.creditsystem.common.bean.CollectionInfo;
import com.woniuxy.creditsystem.common.bean.CustomerInfo;
import com.woniuxy.creditsystem.common.bean.ReturnPlanInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ：luoyue
 * @date ：Created in 2020/12/11
 * @description：催收mapper
 * @modified By：
 * @version: 1.0v
 */
@Mapper
public interface CollectionMapper {


    /**
     * 根据参数进行分页查询
     * @param collectionFind
     * @return
     * @author luoyue
     */
    List<CollectionInfo> findAllByParams(@Param("cf") CollectionFind collectionFind);


    /**
     * 根据客户返回的信息更新催收记录
     * @param collectionInfo
     * @return 受影响的行数
     */
    @Update("<script>" +
            "update collection_info" +
            "<set>" +
            "<if test='cl.colDesc != null'>" +
            "col_desc = #{cl.colDesc}" +
            "</if>" +
            "</set>" +
            "where id = #{cl.id}" +
            "</script>")
    int updateCollectionInfo(@Param("cl") CollectionInfo collectionInfo);


    /**
     * 通过id去查询催收账单里用户得相关信息
     * @param id
     * @return
     */
    CollectionInfo getOneById(Long id);

    /**
     *
     * @param id
     * @return
     */
    CustomerInfo findRPIById(@Param("id") Long id);
}
